package cn.iocoder.yudao.module.pplan.controller.app.serviceequipment;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.pplan.controller.app.serviceequipment.vo.AppServiceEquipmentSaveReqVO;
import cn.iocoder.yudao.module.pplan.service.serviceequipment.ServiceEquipmentService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "用户 APP - 生产计划-服务用具管理")
@RestController
@RequestMapping("/pplan/service-equipment")
@Validated
public class AppServiceEquipmentController {

    @Resource
    private ServiceEquipmentService serviceEquipmentService;

    @PostMapping("/create")
    @Operation(summary = "创建生产计划-服务用具管理")
    public CommonResult<Long> createServiceEquipment(@Valid @RequestBody AppServiceEquipmentSaveReqVO createReqVO) {
        return success(serviceEquipmentService.appCreateServiceEquipment(createReqVO));
    }

    //@PutMapping("/update")
    //@Operation(summary = "更新生产计划-服务用具管理")
    //public CommonResult<Boolean> updateServiceEquipment(@Valid @RequestBody AppServiceEquipmentSaveReqVO updateReqVO) {
    //    serviceEquipmentService.updateServiceEquipment(updateReqVO);
    //    return success(true);
    //}
    //
    //@DeleteMapping("/delete")
    //@Operation(summary = "删除生产计划-服务用具管理")
    //@Parameter(name = "id", description = "编号", required = true)
    //public CommonResult<Boolean> deleteServiceEquipment(@RequestParam("id") Long id) {
    //    serviceEquipmentService.deleteServiceEquipment(id);
    //    return success(true);
    //}
    //
    //@DeleteMapping("/delete-list")
    //@Parameter(name = "ids", description = "编号", required = true)
    //@Operation(summary = "批量删除生产计划-服务用具管理")
    //public CommonResult<Boolean> deleteServiceEquipmentList(@RequestParam("ids") List<Long> ids) {
    //    serviceEquipmentService.deleteServiceEquipmentListByIds(ids);
    //    return success(true);
    //}
    //
    //@GetMapping("/get")
    //@Operation(summary = "获得生产计划-服务用具管理")
    //@Parameter(name = "id", description = "编号", required = true, example = "1024")
    //public CommonResult<AppServiceEquipmentRespVO> getServiceEquipment(@RequestParam("id") Long id) {
    //    ServiceEquipmentDO serviceEquipment = serviceEquipmentService.getServiceEquipment(id);
    //    return success(BeanUtils.toBean(serviceEquipment, AppServiceEquipmentRespVO.class));
    //}
    //
    //@GetMapping("/page")
    //@Operation(summary = "获得生产计划-服务用具管理分页")
    //public CommonResult<PageResult<AppServiceEquipmentRespVO>> getServiceEquipmentPage(@Valid AppServiceEquipmentPageReqVO pageReqVO) {
    //    PageResult<ServiceEquipmentDO> pageResult = serviceEquipmentService.getServiceEquipmentPage(pageReqVO);
    //    return success(BeanUtils.toBean(pageResult, AppServiceEquipmentRespVO.class));
    //}
    //
    //@GetMapping("/export-excel")
    //@Operation(summary = "导出生产计划-服务用具管理 Excel")
    //@ApiAccessLog(operateType = EXPORT)
    //public void exportServiceEquipmentExcel(@Valid AppServiceEquipmentPageReqVO pageReqVO,
    //          HttpServletResponse response) throws IOException {
    //    pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
    //    List<ServiceEquipmentDO> list = serviceEquipmentService.getServiceEquipmentPage(pageReqVO).getList();
    //    // 导出 Excel
    //    ExcelUtils.write(response, "生产计划-服务用具管理.xls", "数据", AppServiceEquipmentRespVO.class,
    //                    BeanUtils.toBean(list, AppServiceEquipmentRespVO.class));
    //}

}